/**
 * This file is a part of qloudgen-rul. 
 * You can redistribute qloudgen-rul and/or modify it under the terms of the Lesser GNU General Public License version 3. 
 * qloudgen-rul is distributed WITHOUT ANY WARRANTY. 
 *
 * See the Lesser GNU General Public License for more details at http://www.gnu.org/licenses/. 
 **/
package org.qloudgen.rul.drools.rule.banking;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

public class Banking {
	/**
	 * Log output.
	 */
	private final static Logger logger = LoggerFactory.getLogger( Banking.class );
	
	public Banking() {
	}

	private String id = null;
	
	public void setId(String id) {
		this.id = id;
	}
	
	public String getId() {
		return id;
	}

	private String country = null;
	
	public void setCountry(String country) {
		this.country = country;
	}

	public String getCountry() {
		return country;
	}

	private String userType = null;
	
	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getUserType() {
		return userType;
	}

	private long amount = 0L;
	
	public void setAmount(long amount) {
		this.amount = amount;
	}

	public long getAmount() {
		return amount;
	}

	private String tranType = null;
	
	public void setTranType(String tranType) {
		this.tranType = tranType;
	}

	public String getTranType() {
		return tranType;
	}

	private Date tranDate = null;
	
	public void setTranDate(Date tranDate) {
		this.tranDate = tranDate;
	}

	public Date getTranDate() {
		return tranDate;
	}

	private String accountNo = null;
	
	public void setAccountNo(String accountNo) {
		this.accountNo = accountNo;
	}

	public String getAccountNo() {
		return accountNo;
	}

	private long balance = 0L;
	
	public void setBalance(long balance) {
		this.balance = balance;
	}

	public long getBalance() {
		return balance;
	}

	private String accType = null;
	
	public void setAccType(String accType) {
		this.accType = accType;
	}

	public String getAccType() {
		return accType;
	}

	private Date openDate = null;
	
	public void setOpenDate(Date openDate) {
		this.openDate = openDate;
	}

	public Date getOpenDate() {
		return openDate;
	}

	private Date closeDate = null;
	
	public void setCloseDate(Date closeDate) {
		this.closeDate = closeDate;
	}

	public Date getCloseDate() {
		return closeDate;
	}

	private String branch = null;
	
	public void setBranch(String branch) {
		this.branch = branch;
	}

	public String getBranch() {
		return branch;
	}

	private String currency = null;
	
	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public String getCurrency() {
		return currency;
	}

	private String status = null;
	
	public void setStatus(String status) {
		this.status = status;
	}

	public String getStatus() {
		return status;
	}

	/////////////////
	private long ref = 0L;
	public void setRef() {
		ref++;
	}
	
	/////////////////
	private boolean isAccount = false;
	public void setAccount() {
		logger.debug( "{}...set account..." , toString() );
		isAccount = true;
	}
	
	private boolean isTran = false;
	public void setTran() {
		logger.debug( "{}...set tran..." , toString() );
		isTran = true;
	}

	private boolean isUser = true;
	public void setUser() {
		isUser = false;
	}

	public boolean isSuccess() {
		logger.debug( "Current result is...{}" , new boolean[]{ isAccount , isTran , isUser } );
		logger.debug( "Current nothing is...{}" , ref );
		return ( isAccount && isTran && isUser );
	}
}